import js from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import { defineConfig, globalIgnores } from 'eslint/config';
import globals from 'globals';

export default defineConfig([
  {
    name: 'app/files-to-lint',
    files: ['**/*.{js,mjs,jsx,vue}'],
  },
  globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
  { languageOptions: { globals: globals.browser } },
  js.configs.recommended,
  ...pluginVue.configs['flat/essential'],
  {
    files: ['**/*.{js,mjs,cjs,vue}'],
    rules: {
      'vue/multi-word-component-names': 'off', // 组件名字必须为多个单词--关闭
      'arrow-body-style': 'off', // 箭头函数后面的大括号检查
      'prefer-arrow-callback': 'off', // 回调函数优先使用剪头函数
      'no-unused-vars': 'off', // 未使用变量--关闭
    },
  },
]);
